<td>
<?php $SQL="SELECT
 cabinet_dossier.id,cabinet_dossier.nom,cabinet_dossier.prenom,cabinet_soins.date  as dateSoin,cabinet_rendezvous.date as dateRDV,cabinet_rendezvous.prochainrendezvous as rndvz,
cabinet_rendezvous.prochainrendezvous_temp as temp FROM cabinet_rendezvous
INNER JOIN cabinet_soins ON cabinet_soins.date = cabinet_rendezvous.date 
INNER JOIN cabinet_dossier ON cabinet_rendezvous.dossierId = cabinet_dossier.id AND cabinet_soins.dossierId = cabinet_dossier.id
 WHERE
cabinet_soins.id =$currentObject->id ";
$rs=ew_LoadRecordset($SQL);
if ($rs && !$rs->EOF) {
	echo $rs->fields['rndvz']."&nbsp;( ".$rs->fields['temp']." )";}
	?></td>
<td><?php $SQL="SELECT
Sum(cabinet_dossier_avance.montant) as montant
FROM
cabinet_soins
INNER JOIN cabinet_dossier_avance ON cabinet_dossier_avance.dossierId = cabinet_soins.dossierId
WHERE
cabinet_soins.id = ".$currentObject->id." AND
DAY(cabinet_dossier_avance.date) = DAY(cabinet_soins.date) and YEAR(cabinet_dossier_avance.date) = YEAR(cabinet_soins.date) and MONTH(cabinet_dossier_avance.date) = MONTH(cabinet_soins.date)";

	
	$rs=ew_LoadRecordset($SQL);if ($rs && !$rs->EOF) $montant=$rs->fields['montant'];echo $montant;?></td><?php 

	

$id=$currentObject->id;?>
<div title="Nouveau acte" id="newacte_<?=$id?>" style="display: none">

<?php 

	$SQL="SELECT * FROM cabinet_acte WHERE portalId=$portalId and natureSoinId=".getObjByKey("cabinet_soinnature","id","nom",$currentObject->naturedesoin,"portalId",$portalId);
	
//	echo $SQL;


	
	$rs=ew_LoadRecordset($SQL);
	
	while ($rs && !$rs->EOF) {
		?>

		<input type="radio" name="newacteradio"  value="<?=$rs->fields["id"]?>"> <?=$rs->fields["nom"]?><br/>
		
		<?php 
		$rs->MoveNext();
	}


//autocomplete("acte_".$id, "acteId_".$id,"loadautocomplete","table=cabinet_acte&key=id&value=nom&filter=natureSoinId=".getObjByKey("cabinet_soinnature","id","nom",$currentObject->naturedesoin,"portalId",$portalId)."&portalId=".$portalId,50);

?></div>


<div title="Nouvelle avance" id="newavance_<?=$id?>" style="display: none">





    Montant d avance    <input type="text" name="montant_<?=$id?>" > <?=$rs->fields["nom"]?><br/>




    </div>
